package com.ysx.exception;
import com.ysx.common.pojo.StatusCode;
import org.springframework.stereotype.Component;

/**
 * 自定义异常
 */
@Component
public class ToutiaoException extends Exception{

    //错误的状态码
    private Integer code;

    //错误信息
    private String message;

    public ToutiaoException() {
        
    }

    public ToutiaoException(String message) {
        this.message=message;
        this.code= StatusCode.CUSTOM_FAILURE.code();
    }

    public ToutiaoException(Integer code,String message) {
        this.code=code;
        this.message=message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}